﻿@{
    ViewBag.Title = "自定义关键词";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
@model List<UcAsp.Net.Model.DefinedCode>
           
<div class="container-fluid">
<span class="btn" id="addsysParam">添加</span>
    <div class="row-fluid">    
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon"><i class="icon-th"></i></span>
                    <h5>
                        变量管理</h5>
                </div>
                <div class="widget-content nopadding">
                    <table class="table table-bordered table-striped">
                        <thead>
                            <tr>
                                <th>
                                    说明
                                </th>
                                <th>
                                    变量名称
                                </th>
                                <th>
                                    变量值
                                </th>
                                <th>
                                    操作
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                        @foreach (UcAsp.Net.Model.DefinedCode u in Model)
                        {
                            <tr>
                            <td>
                            @u.DefinedCodeType
                            </td>
                            <td>
                            @u.DefinedNumber
                            </td>
                            <td>
                            @u.DefinedName
                            </td>
                            <td>
                                 <span class="btn eidt" data-id="@u.ID">编辑</span>
                                 <span class="btn delete" data-id="@u.ID">删除</span>
                            </td>
                            </tr>
                            
                        }
                        </tbody>
                        <tfoot>
                            <tr>
                                <td colspan="3">
                                    <div class="btn-group">
                                        <a class="btn" href="/admin/DefinedCode?PageIndex=1"><i class="icon-step-backward">
                                        </i></a><a class="btn" href="/admin/DefinedCode?PageIndex=@ViewData["Pre"]">
                                            <i class="icon-backward"></i></a>
                                        @for (int i = 1; i < int.Parse(ViewData["PageCount"].ToString()) + 1; i++)
                                        { 
                                            <a class="btn" href="/admin/DefinedCode?PageIndex=@i">
                                                @i.ToString()
                                            </a>
                                        }
                                        <a class="btn" href="/admin/DefinedCode?PageIndex=@ViewData["Next"]">
                                            <i class="icon-forward"></i></a><a class="btn" href="/admin/DefinedCode?PageIndex=@ViewData["PageCount"]">
                                                <i class="icon-step-forward"></i></a>
                                    </div>
                                </td>
                            </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {
        $(".eidt").click(function () {
            $.get("/Admin/EditDefinedCode?ID=" + $(this).attr("data-id"), function (dataResult) {
                $.facebox(dataResult, "ucaspfacebox");
            });
        })
        $("#addsysParam").click(function () {
            $.get("/Admin/EditDefinedCode", function (dataResult) {
                $.facebox(dataResult, "ucaspfacebox");
            });
        })
        $(".delete").click(function () {
            $.post("/Admin/DelDefinedCode", { ID: $(this).attr("data-id") }, function (dataresult) {
                location.reload();
            })
        })
    })
</script>

